package com.yzd.learnjava.containers;

import java.util.LinkedHashSet;
import java.util.Set;

import com.yzd.learnjava.util.CollectionData;
import com.yzd.learnjava.util.Generator;
import com.yzd.learnjava.util.Print;

public class CollectionDataTest {
	public static void main(String[] args) {
		Set<String> set = new LinkedHashSet<String>(
				new CollectionData<String>(new Government(), 15));
		set.addAll(CollectionData.List(new Government(), 15));
		
		Print.print(set);
		
	}
}


class Government implements Generator<String>{
	String[] foundation = "strange women lying in ponds distributing swords is no basis for a system of government".split(" ");
	private int index ;
	public String next() {
		return foundation[index++];
	}
}